<?php if (have_posts()) { ?>

	<?php while (have_posts()) : the_post();
	
		// post image
		$imgurl = get_post_custom_values('ide_post_image', $post->ID);
	?>

		<div class="post">
			<?php if(ide_option('post_strip')) ide_post_strip(); ?>
			
			<?php if($imgurl = @array_pop($imgurl)): ?>
				<div class="post_image"><a href="<?php the_permalink(); ?>"><img src="<?php echo $imgurl; ?>" alt="<?php the_title(); ?>" /></a></div>
			<?php else: ?>
				<h1 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
			<?php endif; ?>

			<div class="meta">
				<p class="category"><?php the_category(', '); ?></p>
				<p class="date"><?php the_time(get_option('date_format')); ?></p>

				<?php if ( comments_open() ) { ?>
					<p class="comments"><?php comments_popup_link('0 comments', '1 comment', '% comments', '', ''); ?></p>
				<?php } ?>

				<div class="clear"> </div>
				
				<p class="author"><?php ide_option('post_author') ? _e('by ').the_author_posts_link() : null; ?></p>
				<?php if(has_tag()) { ?><p class="tags"><?php the_tags(); ?></p><?php }; ?>
				<div class="clear"> </div>
			</div><!-- .meta //-->

			<?php if(!empty($imgurl)): ?>
				<h1 class="title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
			<?php endif; ?>
			
			<div class="text">
				<?php
					if(!ide_option('post_content'))
						the_content(_('continue reading..'));	// show full post
					else
						the_excerpt(_('continue reading..'));	// excerpt
				?>
				<div class="clear"> </div>
			</div><!-- .text //-->
			
			<div class="clear"> </div>
		</div><!-- .post //-->

	<?php endwhile; ?>
	
	<div class="pagination">
		<div class="alignleft"><?php next_posts_link('&laquo; '._('Older Entries')); ?></div>
		<div class="alignright"><?php previous_posts_link(_('Newer Entries').' &raquo;'); ?></div>
		<div class="clear"> </div>
	</div>

<?php } else {
		_e( !empty($empty_message) ? $empty_message : '<h1>Sorry!</h1>Sorry, the requested content was not found.');
	}
?>